package com.transaction.demo.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.transaction.demo.base.vo.req.SysUserRoleListReqVo;
import com.transaction.demo.base.vo.req.SysUserRoleAddReqVo;
import com.transaction.demo.base.vo.resp.SysUserRoleRespVo;
import com.transaction.demo.base.biz.SysUserRoleBiz;
import com.transaction.demo.base.service.SysUserRoleService;

/**
 * 描述：用户和角色关联表
 * 作者：马庆智
 * 日期：2023/03/28 17:07:15
 */
@Service
public class SysUserRoleServiceImpl implements SysUserRoleService {

	@Autowired
	private SysUserRoleBiz sysUserRoleBiz;

	/**
	 * 查询用户和角色关联表列表
	 *
	 * @param sysUserRole 请求参数
	 * @return SysUserRoleResp
	 * @author 马庆智
	 * @date: 2023/03/28 17:07:15
	 */
	@Override
	public List<SysUserRoleRespVo> querySysUserRoleList(SysUserRoleListReqVo sysUserRole) {

		return sysUserRoleBiz.querySysUserRoleList(sysUserRole);
	}

	/**
	 * 添加用户和角色关联表
	 *
	 * @param sysUserRole 请求参数
	 * @return int
	 * @author 马庆智
	 * @date: 2023/03/28 17:07:15
	 */
	@Override
	public int saveSysUserRole(SysUserRoleAddReqVo sysUserRole) {

		return sysUserRoleBiz.saveSysUserRole(sysUserRole);
	}

	/**
	 * 删除用户和角色关联表
	 *
	 * @param userId 用户id
	 * @return int
	 * @author 马庆智
	 * @date: 2023/03/28 17:07:15
	 */
	@Override
	public int deleteSysUserRole(Integer userId) {
		return sysUserRoleBiz.deleteSysUserRole(userId);
	}

}